/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nominalitzacions.drivers;

import java.util.*;
import nominalitzacions.persistance.FormsDataManager;
import java.io.*;
import java.io.IOException;
import nominalitzacions.domain.CreateVerbalForms;
import nominalitzacions.stubs.Dictionary;



/**
 *
 * @author sonia.sandalinas
 */
public class CreateVerbalFormsDriver {
    public static void main(String [] args) {
        System.out.println("Escriu la ruta del fitxer origen dels verbs irregulars:");
        Scanner sc = new Scanner(System.in);
        FormsDataManager FDM = null;
        try {
            FDM = new FormsDataManager(sc.next());
        } catch (IOException ex) {
            System.out.println(ex.getMessage());
        }
        System.out.println("Escriu la ruta del fitxer dels infinitius");
        Scanner sc1 = new Scanner(System.in);
        FormsDataManager FDM2 = null;
        try {
            FDM2 = new FormsDataManager(sc1.next());
        } catch (IOException ex) {
            System.out.println(ex.getMessage());
        }
        Dictionary<String> dic = null;
        try {
            dic = FDM2.readDiccionari();
        } catch (FileNotFoundException ex) {
            System.out.println(ex.getMessage());
        } catch (IOException ex) {
            System.out.println(ex.getMessage());
        }
        CreateVerbalForms v = new CreateVerbalForms();
        v.generateVerb(FDM, dic);
        try {
            FDM2.writeDiccionari(dic);
        } catch (IOException ioe) {
            System.out.println(ioe.getMessage() );
        }
    }
}